package com.school.manager.domaim;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.school.manager.annotations.OrderBy;

import lombok.Getter;
import lombok.Setter;

/**
 * description：映射实体类公共父类 
 * date：2021/2/510:22 上午
 */

@Getter
@Setter
public class BaseDomain<T extends Model<?>> extends Model<T> implements Serializable {

	@TableId(type = IdType.UUID)
	/**
	 * 主键
	 */
	private String id;
	
	/**
	 * 创建人id
	 */
	@TableField(value = "create_user", fill = FieldFill.INSERT, strategy = FieldStrategy.NOT_EMPTY)
	private String createUser;
	
	/**
	 * 创建时间
	 */
	@TableField(value = "create_time", fill = FieldFill.INSERT, strategy = FieldStrategy.NOT_EMPTY)
	private Long createTime;
	
	/**
	 * 修改人id
	 */
	@TableField(value = "update_user", fill = FieldFill.INSERT_UPDATE)
	private String updateUser;
	
	/**
	 * 修改时间
	 */
	@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
	@OrderBy
	private Long updateTime;
	
	/**
	 * 状态(1可用，0不可用)
	 */
	@TableField("status")
	private String status;

	@Override
	protected Serializable pkVal() {
		return this.id;
	}
}
